function impedance_from_a(CONSTS, plot_data)

    phi = 0;
    m_max = 15; %20
    a_low_order  = 1;
    a_high_order = 10;
    num_points   = 10;
    a_vec = linspace(a_low_order, a_high_order, num_points)';
    %a_vec = 3;
    %a_vec = linspace(a_low_order, a_high_order, 5)';
    Z_vec = zeros(size(a_vec));
    Z_odn_pl_vec = zeros(size(a_vec));
    for i = 1:size(a_vec,1)
        a = a_vec(i);

        LOCAL_CONSTS = CONSTS;
        LOCAL_CONSTS.a = a;
        LOCAL_CONSTS = update_CONSTS(LOCAL_CONSTS);
        
        I_full = func_I_full(phi, m_max, LOCAL_CONSTS);
        Z_vec(i) = 1 ./ I_full;

        I_odn_pl = sum_I_odn_pl(phi, LOCAL_CONSTS);
        Z_odn_pl_vec(i) = 1 ./ I_odn_pl;
        
        if(false)
            coef_sgs_to_si   = 9e+11;
            fprintf('a     =  %e  cm \n', a);
            fprintf('Z     =  %e  + i %e  Om \n', coef_sgs_to_si*real(Z_vec(i)), ...
                                                  coef_sgs_to_si*imag(Z_vec(i)));
            fprintf('Z_odn =  i %e  Om \n',       coef_sgs_to_si*imag(Z_odn_pl_vec(i)));
        end
    end

    coef_sgs_to_si   = 9e+11;
    Z_sgs_vec_re     = real(coef_sgs_to_si*Z_vec);
    Z_sgs_vec_im     = imag(coef_sgs_to_si*Z_vec);
    Z_sgs_odn_vec_im = imag(coef_sgs_to_si*Z_odn_pl_vec);

    if(plot_data)
        figure; plot(a_vec, (1)*Z_sgs_vec_re, 'b.-', ...
                     a_vec, (1)*Z_sgs_vec_im, 'm.-', ...
                     a_vec, (1)*Z_sgs_odn_vec_im, 'rx-'); grid; 
        title('Z(a)'); 
        xlabel('a, cm'); ylabel('R, X');
        legend('Re Z', 'Im Z', 'Im Z for homogen. plasma', ...
            'location', 'SouthEast');
    end

end